-
Notifications
You must be signed in to change notification settings - Fork 1.7k
C++: add isVla
predicated to ArrayType
#19298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9d8403e
to
3ed4a8d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new predicate, isVla(), in the ArrayType class to enable detection of variable-length arrays. Key changes include:
- Creating a new table, type_is_vla.
- Adding the isVla() predicate in ArrayType.
- Updating change notes and upgrade/downgrade scripts.
Files not reviewed (4)
- cpp/downgrades/fe54db1af25b6d8a1e25f6cbeae68baf615efc87/upgrade.properties: Language not supported
- cpp/ql/lib/semmle/code/cpp/Type.qll: Language not supported
- cpp/ql/lib/semmlecode.cpp.dbscheme: Language not supported
- cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/upgrade.properties: Language not supported
13eb715
to
c39dc16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment, which will unfortunately be a bit of annoying work, otherwise LGTM.
cpp/ql/lib/semmlecode.cpp.dbscheme
Outdated
@@ -2178,6 +2178,8 @@ variable_vla( | |||
int decl: @stmt_vla_decl ref | |||
); | |||
|
|||
type_is_vla(unique int type_id: @type ref) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to be a bit painful (because you need to re-do the upgrade scripts, and possibly also the stats file), but you should be able to do the following:
type_is_vla(unique int type_id: @type ref) | |
type_is_vla(unique int type_id: @derivedtype ref) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! 👍
I'll change that.
a033a95
to
ae07272
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR does the following:
type_is_vla
.isVla
, in theArrayType
class.